﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Web.Areas.Portal.Models.EventModel>" %>
<%@ Import Namespace="System.IO" %>

<!-- start id-form -->
<% using (Html.BeginForm("Create", "Event", FormMethod.Post, new { id = "formID", enctype = "multipart/form-data", @class = "validateform" }))    
     { %>
        <% = Html.HiddenFor(x => x.Event.ID) %>
        <% = Html.HiddenFor(x => x.Event.Event_ID) %>
        <% = Html.HiddenFor(x => x.Event_Local.Event_ID) %>
        <% = Html.HiddenFor(l => l.Event.LanguageFID) %>
        <% = Html.HiddenFor(l => l.Event_Local.LanguageFID) %>
        <style type="text/css">
            .style1
            {
                width: 34%;
            }
            .style2
            {
                width: 99px;
            }
            
            .style_datetime {
                border: 1px solid #AAA;
                padding: 5px;
            }
            
        </style>
        <table border="0" cellpadding="0" cellspacing="0"  class="tbl-form">
        <tr>
            <th valign="top" width="40px"><span class="mandate">*</span> Title:</th>
            <td width="40%">
               <br/> <b>English</b><br/><br/>
            <%= Html.TextBoxFor(m => m.Event.Title, new { name = "title", id = "title", @class = "validate[required] inp-form", style = "width:97%" })%>
            </td>
            <td class="style2" width="10px">
                &nbsp;</td>
            <td width="40%">
                <br/> <b>Local</b><br/><br/>
                <%= Html.TextBoxFor(m => m.Event_Local.Title, new { name = "title", id = "title", @class = "validate[required] inp-form", style = "width:97%" })%>
            </td>
           </tr>
     <%--   * Event Start Date: Eg: 09-Aug-2011 (dd-MMM-yyyy)  Eg: 17:00 (hh:mm)* Event End Date: Eg: 09-Aug-2011 (dd-MMM-yyyy)
--%>

        <tr>
          <th width="40px" ><span class="mandate">*</span> Date:</th>
            <td align="left" colspan="4">
                <table class="style1">
                    <tr>
                        
                        <td>
                            
                             <%= Html.TextBoxFor(m => m.Event.EventDate, new { name = "EventDate", id = "EventDate", @class = "validate[required] style_datetime ", style = "width:150px;" })%>
                        </td>
                        
                        <td width="5px">
                              &nbsp;</td>
                        
                        <td>
                              <%= Html.TextBoxFor(m=>m.Event.EventTime, new { name = "EventTime", id = "EventTime", @class = "validate[required] style_datetime", style = "width:68px;" })%>
                        </td>
                        
                        <td width="5px">
                            &nbsp;</td>
                        
                        <td>
                           &nbsp;&nbsp;<b> to </b> &nbsp;&nbsp;</td>
                        <td width="5px">
                            &nbsp;</td>
                        <td>
                            <%= Html.TextBoxFor(m => m.Event.EventDateEnd, new { name = "EventDateEnd", id = "EventDateEnd", @class = "validate[required] style_datetime", style = "width:150px;" })%>
                        </td>
                        <td width="5px">
                            &nbsp;</td>
                        <td>
                            <%= Html.TextBoxFor(m => m.Event.EventTimeEnd, new { name = "EventTimeEnd", id = "EventTimeEnd", @class = "validate[required] style_datetime", style = "width:68px;" })%>
                        </td>
                    </tr>
                    <%--<tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>--%>
                </table>
            </td>
        </tr>
         <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Where:</th>
            <td align="left" valign="middle" width="40%">
                <br/> <b>English</b><br/><br/>
            <%= Html.TextBoxFor(m => m.Event.Where, new { name = "where", id = "where", @class = "validate[required] inp-form", style = "width:97%" })%>
            </td>
            <td align="left" valign="middle" class="style2" width="10px">
                &nbsp;</td>
            <td align="left" valign="middle" width="40%">
                <br/> <b>Local</b><br/><br/>
                 <%= Html.TextBoxFor(m => m.Event_Local.Where, new { name = "where", id = "where1", @class = "validate[required] inp-form", style = "width:97%" })%>
            </td>
           </tr>
        
        <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Event Summary:</th>
            <td style="width:600px;" align="left" valign="middle" width="40%">
                
            <input id="summary_validate" class="validate[required]" style="visibility:hidden;height:0;width: 0"/>
            <br/><b>English</b><br/><br/>
             <%= Html.TextAreaFor(m => m.Event.EventSummary, new { id = "summary", name = "summary", @class = "ckeditors", cols = "88", rows = "10", style = "width:100%" })%>
            </td>
           
            <td align="left" valign="middle" class="style2" width="10px">
                &nbsp;</td>
           
            <td style="width:600px;" align="left" valign="middle" width="40%">
                
                <input id="summary_local_validate" class="validate[required]" style="visibility:hidden;height:0;width: 0"/>
                <br/> <b>Local</b><br/><br/>
             <%= Html.TextAreaFor(m => m.Event_Local.EventSummary, new { id = "summary_local", name = "summary1", @class = "ckeditors", cols = "88", rows = "10", style = "width:100%" })%>
            </td>
           
        </tr>
        <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Event Detail:</th>
            <td style="width:600px;" align="left" valign="middle" width="40%">
                
             <input id="content_validate" class="validate[required]" style="visibility:hidden;height:0;width: 0"/>
             <br/> <b>English</b><br/><br/>
                <%= Html.TextAreaFor(m => m.Event.EventContent, new { id = "event_content", name = "event_content", @class = "ckeditors", cols = "88", rows = "10", style = "width:100%" })%>
            </td>
            
            <td align="left" valign="middle" class="style2" width="10px">
                &nbsp;</td>
            
            <td style="width:600px;" align="left" valign="middle" width="40%">
                
                 <input id="content_local_validate" class="validate[required]" style="visibility:hidden;height:0;width: 0"/>
                 <br/> <b>Local</b><br/><br/>
                <%= Html.TextAreaFor(m => m.Event_Local.EventContent, new { id = "content_local", name = "event_content1", @class = "ckeditors", cols = "88", rows = "10", style = "width:100%" })%>
            </td>
            
        </tr>
        
        <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Email:</th>
            <td align="left" valign="middle" colspan="3">
            <%= Html.TextBoxFor(m => m.Event.ContactEmail, new { name = "event_email", id = "event_email", @class = "validate[required,custom[email]] inp-form" })%>
            </td>
           
        </tr>
        
       <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Attachment:</th>
            <td align="left" valign="middle" colspan="3">
                <div style="text-align:left;min-width: 437px;">
                    <input type="file" name="files" id="files_0"/><br /><br />
                    <input type="file" name="files" id="files_1"/><br /><br />
                    <input type="file" name="files" id="files_2"/><br /><br />
                  
                  </div>
                 
                  <div style="text-align:left;min-width: 437px;">
                      <%
                          var files = ViewData["files"] as List<FileInfo>;
                          if (files != null)
                          {%>
                            <p><span style="font: italic"><i>(Right click on the file -> choose Save as... to download file)</i></span></p>
                            <br/>
                             <% 
                              foreach (var file in files)
                              {
                                %>
                                <a href="<%=file.FullName %>"><%=file.Name %></a>
                                 <%= Html.ActionLink(" ", "DeleteFile", new { e = Model.Event.Event_ID, l = Model.Event.LanguageFID, filename=file.FullName }, new { @title = "Delete", @class = "icon-2 info-tooltip remove-btn" })%> 
                                 <br /><br />
                                 
                                <%
                              }
                          }
                          %>
                   
                   
                    
                  
                  </div>
              </td>
           
        </tr>
        <tr>
            <th valign="middle" width="40px"><span class="mandate">*</span> Event Color:</th>
            <td align="left" valign="middle" colspan="3">
               <%= Html.TextBoxFor(m => m.Event.EventColor, new { name = "EventColor", id = "EventColor", @class = "validate[required] inp-form" })%> 
            </td>
           
        </tr>
        <tr>
        <th valign="middle" width="40px"><span class="mandate">*</span> Status:</th>
        <td align="left" valign="middle" colspan="3">
            <div class="select_holder">
                 <%=Html.DropDownListFor(m => m.Event.Status, new List<SelectListItem>
                     {
                        new SelectListItem{Selected = true, Text="Active", Value = "true" }, 
                        new SelectListItem{Selected = false, Text="Inactive", Value = "false" },
                     }, new { id = "event_status", name = "event_status", @class = "chzn-nosearch chz" })%>
            </div>
        </td>
       
        </tr>
        
        <tr>
            <td colspan="5" ><div class="form_divider"></div></td><!--------------------------------------------------------------------->
        </tr>
        

        <tr>
            <td colspan="5">&nbsp;</td>
        </tr>
        <tr>
            <th>&nbsp;</th>
            <td valign="top" colspan="3">
                <input type="submit" value="Submit"  onclick="checkForm()" class="buttons" style="margin-right:8px;float:left" />
                <%--<input type="submit" value="" class="form-submit" onclick=" checkFormAndUpload(); " />--%>
                <input type="reset" value="Reset" class="buttons" style="margin-right:8px;float:left"  />
            </td>
            <td></td>
        </tr>
        </table>
   <%} %><!-- end id-form  -->